<template>
  <div>
    <div>
      <mt-header title="景点详情" style="background: linear-gradient(#000000, #035838);">
        <mt-button icon="back" slot="left" @click="goBack()">返回</mt-button>
      </mt-header>
    </div>

    <iframe class="iframe" v-bind:src="localhost+this.symbol+this.jwd"></iframe>


    <div id="divbody" class="div-body" v-html="info">
      {{info}}
    </div>
  </div>
</template>
<script>
import axios from "axios";
import { Indicator } from "mint-ui";
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      jqid: this.$route.query.jqid,
      jwd: this.$route.query.jwd,
      info: "",
      localhost: "",
      symbol: "?jwd="
    };
  },
  created() {
    // 该方法用来更改tabbarshow的值 用来 展示、隐藏底部 tabbar (boolean为0 展示、boolean为1 隐藏)
    this.$store.dispatch("showTabbar", { boolean: "1" });
  },
  updated() {
    if (this.info) {
      $("img").css({ width: "100%", height: "auto" });
    }
  },
  mounted() {
    this.getDetailsIntroduction();
    this.gethost();
  },
  methods: {
    goBack() {
      history.go(-1);
    },
    gethost() {
      let domain = window.location.host;
      this.localhost = "http://" + domain + "/#/acttractionsmap";
      console.log(this.localhost);
      
    },
    getDetailsIntroduction() {
      axios({
        method: "post",
        url: "/api/jdxqjs/list.htm",
        params: {
          jqid: this.jqid
        }
      }).then(res => {
        res = res.data;
        if (res.zt === true) {
          this.info = res.data[0].xxxx;
        } else {
          Indicator.close();
          let instance = Toast({
            message: "加载失败"
          });
          setTimeout(() => {
            instance.close();
          }, 2000);
        }
      });
    }
  }
};
</script>
<style scoped>
.child-view {
  height: 100%;
      position: relative;
}
.mint-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99;
}
.div-body {
  padding: 5px;
}
.iframe {
  padding-top: 40px;
  width: 97.5%;
  height: 250px;
  text-align: center;
}
</style>
